package com.leyou.search.service;

import com.leyou.item.entity.Spu;
import com.leyou.search.entity.Goods;
import com.leyou.search.entity.SearchRequest;
import com.leyou.search.entity.SearchResult;

import java.io.IOException;

/**
 * @author linzx
 * @date 2020/3/26
 */
public interface LySearchService {
    /**
     * 创建索引和映射
     */
    void createIndexsAndMapping(Class clazz);
    /**
     * 删除索引
     */
    void deleteIndex(Class clazz);

    /**
     * 创建goods索引数据
     */
    Goods buildGoods(Spu spu) throws IOException;

    SearchResult search(SearchRequest request);

    void creatOrUpdateIndex(Long spuId) throws Exception;

    void deleteIndexById(Long spuId);
}
